package cn.elwy.rcp.ui.provider;

import java.util.List;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;

/**
 * 数据转换器接口
 * 
 * @author huangsq
 * @version 1.0, 2014-06-23
 * @since 1.0, 2014-06-23
 */
public interface DataParser {

  public String[] parseTexts(Object element);

  public String parseText(Object element, int columnIndex);

  public Image parseImage(Object element, int columnIndex);

  public Object[] getChildren(Object parentElement);

  public Color getForeground(Object element, int columnIndex);

  public Color getBackgroundColor(Object element, int columnIndex);

  /**
   * 判断是否选中
   * 
   * @param element
   * @return
   */
  public boolean isChecked(Object element);

  /**
   * 判断是否可选
   * 
   * @param element
   * @return
   */
  public boolean isGrayed(Object element);

  public boolean isSetForeground();

  public boolean isSetBackground();

  // public void setConfigure(HeaderConfig configure);
  // public HeaderConfig getConfigure();

  public Object[] getShowItems(int start, int end, List<?> list);

}
